<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.3.3/echarts.min.js"></script>
</head>
<body>
  
    <div style="width: 600px;height: 400px;"></div>
    <script>
          //1.引入echarts.js
          //2.准备一个具备大小（宽高）的dom
          //3.初始化echarts实例
          //4.设置option
        var myChart = echarts.init(document.querySelector('div'));
        var option = {
            yAxis:{
                typeof: 'category',
                data: ['张三','李四','王五','闰土','小明','茅台','二妞','大强']

            },
            xAxis:{
                typeof: 'value',
                
            },
            series: [
                {type:'bar',
                data: [88,92,63,77,94,80,72,86],
                markPoint: {
                    data:[
                        {
                            name:'最大值',
                            type:'max'
                        },
                        {
                            name: '最小值',
                            type: 'min'
                       }
                     ]
                },
                markLine: {
                    data: [
                        {
                            name: '平均值',
                            type: 'average'
                        }
                    ]

                },
                label: {
                    show:true,
                    position: 'right',
                    formatter: '{c}'
                },
                barWidth: '30%',
                

            }


        ]

        }
        myChart.setOption(option);

        </script>
</body>
</html>